﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Hydra.Shell.Attributes;
using Hydra.Shell.Enumerations;
using System.Collections.Generic;
using Hydra.Shell.Implementations;

namespace Hydra.Shell.Interfaces
{
    [Guid("A928AA21-EA77-47AC-8A07-355206C94BDD")]
    public interface IHydraRunningDocumentTable : IEnumerable<HydraRunningDocumentInfo>, IUnknown
    {
        bool AdviseRunningDocTableEvents(IHydraRunningDocTableEvents pSink, out uint pdwCookie);
        bool FindAndLockDocument(HydraRunningDocumentTableFlags dwRDTLockType, string pszMkDocument, out IHydraHierarchy ppHier, out uint pitemid, out IUnknown ppunkDocData, out uint pdwCookie);
        bool GetDocumentInfo(uint docCookie, HydraRunningDocumentTableFlags pgrfRDTFlags, out uint pdwReadLocks, out uint pdwEditLocks, out string pbstrMkDocument, out IHydraHierarchy ppHier, out uint pitemid, out IntPtr ppunkDocData);
        bool LockDocument(HydraRunningDocumentTableFlags grfRDTLockType, uint dwCookie);
        bool ModifyDocumentFlags(uint docCookie, HydraRunningDocumentTableFlags grfFlags, bool fSet);
        bool NotifyDocumentChanged(uint dwCookie, HydraRunningDocumentTableAttributes grfDocChanged);
        bool NotifyOnAfterSave(uint dwCookie);
        bool NotifyOnBeforeSave(uint dwCookie);
        bool RegisterAndLockDocument(HydraRunningDocumentTableFlags grfRDTLockType, string pszMkDocument, IHydraHierarchy pHier, uint itemid, IUnknown punkDocData, out uint pdwCookie);
        bool RegisterDocumentLockHolder(HydraRunningDocumentTableFlags grfRDLH, uint dwCookie, IHydraDocumentLockHolder pLockHolder, out uint pdwLHCookie);
        bool RenameDocument(string pszMkDocumentOld, string pszMkDocumentNew, IHydraHierarchy pHier, uint itemidNew);
        bool SaveDocuments(HydraRunningDocumentTableSaveOptions grfSaveOpts, IHydraHierarchy pHier, uint itemid, uint docCookie);
        bool UnadviseRunningDocTableEvents(uint dwCookie);
        bool UnlockDocument(HydraRunningDocumentTableFlags grfRDTLockType, uint dwCookie);
        bool UnregisterDocumentLockHolder(uint dwLHCookie);
        bool CloseDocuments(HydraRunningDocumentTableSaveOptions grfSaveOptions, IHydraHierarchy pHierarchy, uint docCookie);
        bool QueryCloseRunningDocument(string pszMkDocument, out bool pfFoundAndClosed);
        bool FindAndLockDocumentEx(HydraRunningDocumentTableFlags grfRDTLockType, string pszMkDocument, IHydraHierarchy pHierPreferred, uint itemidPreferred, out IHydraHierarchy ppHierActual, out uint pitemidActual, out IUnknown ppunkDocDataActual, out uint pdwCookie);
        bool FindOrRegisterAndLockDocument(HydraRunningDocumentTableFlags grfRDTLockType, string pszMkDocument, IHydraHierarchy pHierPreferred, uint itemidPreferred, IUnknown punkDocData, out IHydraHierarchy ppHierActual, out uint pitemidActual, out IUnknown ppunkDocDataActual, out uint pdwCookie);
    }
}
